package com.tree.thrive.business.log.service;

import com.tree.thrive.business.log.exception.ExceptionForLogException;
import lombok.extern.slf4j.Slf4j;

/**
 * top-tree
 *
 * @Auther: cheng.tang
 * @Date: 2022/6/18 11:29 PM
 * @Description:
 */
@Slf4j
public class FillInStackTraceExceptionService {

    protected void exceptionHappenedMethodWithFillInStackTrace() {
        try {
            throw new ExceptionForLogException("抛异常了");
        } catch (Exception e) {
//            log.warn("异常出现时的第一现场  e.fillInStackTrace() ", e.fillInStackTrace());
            throw e;
        }
    }


    protected void bizServiceWithFillInStackTrace() {
        try {
            exceptionHappenedMethodWithFillInStackTrace();
        } catch (Exception e) {
//            log.warn("异常出现时的第二现场 e.fillInStackTrace()", e.fillInStackTrace());
            throw e;
        }
    }

}
